<template>
    <div class='box-inline'  v-if='show'>
        <slot></slot>
    </div>
</template>
<script>
    import {mapGetters} from 'vuex'
    import {oneOf} from '../../utils/index'
    import {GET_FAR_STATUS} from '../../serves/data-status'
    export default{
        name:'RegionDisplay',
        props:{
            pData:String,
        },
        data(){
            return{
                list:{
                    'province':"3",
                    'city':"2",
                    'district':"1",
                }
            }
        },
        computed:{
            ...mapGetters({
                user_info: 'user',
            }),
            show(){
                if(oneOf(this.pData,['province','city','district'])){
                   if(this.user_info.info.level == this.list[this.pData]){
                       return true
                   } else {
                       if(this.user_info.info.level == '4'){
                           return true
                       }else {
                           return false
                       }
                   }
                }else {
                    return false;
                }
            }
        },
        mounted(){

        },
        methods:{

        },
        watch:{

        }
    }
</script>